﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;

namespace WindowsFormsApplication1
{
    public class ItemInfo
    {
        public string Filename {get;set;}
        public Guid Id { get; set; }
        public long Size { get; set; }
        public byte[] Hash { get; set; }
        public byte[] Content { get; set; }
        
        public List<int> Duplicates {get; set;}
        
        public ItemInfo(FileInfo iInfo)
        {
            Id = new Guid();
            Duplicates = new List<int>();
            Filename = iInfo.FullName;
            Size = iInfo.Length;

            using (var stream = iInfo.OpenRead())
            {
                Hash = MD5.Create().ComputeHash(stream);
            }
        }
    }
}
